Anaconda中打开自带的jupyter出现连接不上python服务的问题
问题描述:
在Anaconda中选择自己创建的环境,打开jupyter,打印语句无法输出,关键字颜色没变,运行出现In[*]
![](https://img2020.cnblogs.com/blog/1950598/202010/1950598-20201010184216811-1567107281.png)
![](https://img2020.cnblogs.com/blog/1950598/202010/1950598-20201010184113529-147075215.png)
观察左边红色框中的🔗符号,这说明当前环境没有连接上python的服务,使用快捷键shift+enter后运行出现In[*]
解决方案:
1、将创建环境中jupyter notebook完全卸载,我选用pip uninstall jupyter notebook 无法将依赖的包完全删除,建议采用命令conda uninstall notebook,当完全卸载后再进入Anaconda界面,可以看到jupyter中不是launch而是install,说明你已完全删除
conda uninstall notebook
![](https://img2020.cnblogs.com/blog/1950598/202010/1950598-20201010184252550-1534045034.png)
2、在命令行重新安装jupyter notebook
pip install jupyter
pip install jupyter notebook
3、安装完成以后,在命令行保证当前环境已激活的状态下,直接命令行打开jupyter notebook
![](https://img2020.cnblogs.com/blog/1950598/202010/1950598-20201010184321176-1724332620.png)
再次进入看到python 旁边的符号变成空心圆圈,表明已成功连接上python环境
![](https://img2020.cnblogs.com/blog/1950598/202010/1950598-20201010184354007-22031637.png)
相应的关键字也会变成绿色
![](https://img2020.cnblogs.com/blog/1950598/202010/1950598-20201010184432069-994745801.png)
写在后面:
这个问题总结起来还是环境的问题,当我不使用自己创建的环境,使用PC自带的base环境时是能正常使用的,查阅了别人的解决方案,多数都是建议重新安装jupyter,但是我尝试的使用pip卸载后,由于没有完全卸载干净而安装后依然无效。
|